<script>
    window.SERVER_TIME = '<!--#config timefmt="%Y-%m-%d %H:%M:%S"--><!--#echo var="DATE_LOCAL"-->';

    (function () {
        var match = /server_time=([^&\?]+)/.exec(location.search);
        var array;
        if (match) {
            array = match[1].split(/[-\s:]/);
        } else {
            array = window.SERVER_TIME.split(/[-\s:]/);
        }

        window.SERVER_TIME_DATE = new Date(array[0], (array[1] - 1) || 0, array[2] || 0, array[3] || 0, array[4] || 0, array[5] || 0, 0);
        var localDate = new Date();
        var diff = window.SERVER_TIME_DATE.getTime() - localDate.getTime();

        window.GET_SERVER_TIME = function () {
            return new Date(new Date().getTime() + diff);
        };
    })();
</script>